﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using RaytracerLib.MathLib.Polynomials;

namespace RaytracerLib.MathLib.RootFinders
{
    public abstract class BracketedRootFinder : RootFinder
    {
        public override double FindRoot(double a_a, double a_b, Func<double, double> a_func,
            Func<double, double> a_d1)
        {
            return FindRoot(a_a, a_b, a_func);
        }

        public override double FindRoot(double a_a, double a_b, Func<double, double> a_func,
            Func<double, double> a_d1, Func<double, double> a_d2)
        {
            return FindRoot(a_a, a_b, a_func);
        }

        public override double FindRoot(double a_a, double a_b, Polynomial a_poly)
        {
            return FindRoot(a_a, a_b, (x) => a_poly.Evaluate(x));
        }

    }
}
